function Myset() {
    this.items = {}
}

Myset.prototype.has = function (value) {
    return this.items.hasOwnProperty(value)
}

Myset.prototype.add = function (value) {
    if (this.has(value)) return false
    this.items[value] = value
    return true
}

Myset.prototype.remove = function (value) {
    if (!this.has(value)) return false
    delete this.items[value]
    return true
}

Myset.prototype.clear = function () {
    this.items = {}
}

Myset.prototype.size = function () {
    return Object.keys(this.items).length
}

Myset.prototype.values = function () {
    return Object.keys(this.items)
}

var set = new Myset()
set.add(1)
set.add(1)
set.add(100)
set.add(200)
console.log(set.values());
console.log(set.has(100));
set.remove(100)
console.log(set.values());
console.log(set.size());
set.clear()
console.log(set.values());